<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
  <title>发布帖子</title>
  <link rel="stylesheet" href="/css/bootstrap.min.css">
  <script src="/js/jquery-3.2.1.min.js"></script>
  <script src="/js/bootstrap.min.js" type="application/javascript"></script>
  <link rel="stylesheet" type="text/css" href="/css/editormd.min.css">
  <link rel="stylesheet" href="/css/my.css">
  <script src="/js/editormd.min.js"></script>
  <script type="text/javascript">
    //初始化Markdown编辑器
    var contentEditor;
    $(function() {
      contentEditor = editormd("md-content", {
        width   : "100%",//宽度
        height  : 500,//高度
        syncScrolling : "single",//单滚动条
        path    : "/lib/"//依赖的包路径
      });
    });
  </script>

</head>
<body>

<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" th:href="@{/}">博客系统</a>
    </div>
    <div>
      <ul class="nav navbar-nav">
        <li class="active"><a th:href="@{/search/all}">博客广场</a></li>
      </ul>
    </div>
    <div>
      <ul class="nav navbar-nav">
        <li class="active"><a th:href="@{/blog/own}">我的博客</a></li>
      </ul>
    </div>
    <div>
      <ul class="nav navbar-nav">
        <li class="active"><a th:href="@{/history/list}">历史记录</a></li>
      </ul>
    </div>
    <div>
      <ul class="nav navbar-nav">
        <li class="active"><a th:href="@{/user/myStar}">我的关注</a></li>
      </ul>
    </div>
    <label class="navbar-right row">
      <h4><em th:text="${session.username}"></em>,你好 <a
              th:href="@{/blog/loginOut}">
        退出登录</a>
      </h4>
    </label>
  </div>
</nav>


<div class="panel panel-success">
  <div class="panel-heading">
    <h3 class="panel-title">发布帖子</h3>
  </div>
  <div class="panel-body">
    <form class="form-horizontal" role="form" action="/blog/publish"
          method="post">
      <!---隐藏的用户名-->
      <div class="form-group">
        <div class="col-xs-12">
          <input type="text" class="form-control" name="title"
                 placeholder="请输入标题">
        </div>
      </div>
      <div class="form-group">
        <div class="col-xs-12" id="md-content" contenteditable="true">
          <textarea class="form-control" rows="3" placeholder="请输入内容"
                    name="content" th:width="300px"></textarea>
        </div>
      </div>
      <!--<div class="form-group">
        <div class="col-xs-6">
          <img src="/wp-content/uploads/2014/06/download.png" class="img-rounded" id="avatar"/>
        </div>
        <div class="col-xs-6" >
          <button type="button" class="btn btn-success" onclick="showAction();" style="margin-top:100px">上传图片</button>
        </div>
      </div>-->
      <div class="form-group">
        <div class="col-xs-10">
          <button type="submit" class="btn btn-primary"
                  >发布帖子
          </button>
        </div>
      </div>
    </form>
  </div>
</div>
</body>
</html>